<extend name="Public/base" />

<block name="body">
	<!-- 标题栏 -->
	<div class="main-title">
		<h2>项目列表</h2>
	</div>
	<div class="cf">
		<div class="fl">
            <button class="btn document_add" url="{:U('Operate/add')}">发布项目</button>
            <button class="btn ajax-post" url="{:U('Operate/succPro')}" target-form="ids">审核通过</button>
            <button class="btn ajax-post" url="{:U('Operate/denyPro')}" target-form="ids">不通过</button>
            <!--<button class="btn ajax-post confirm" url="{:U('Operate/delPro')}" target-form="ids">删 除</button>-->
        </div>

        <!-- 高级搜索 -->
		<div class="search-form fr cf">
			<div class="sleft">
				<input type="text" name="nickname" class="search-input" value="{:I('nickname')}" placeholder="请输入项目名称或者ID">
				<a class="sch-btn" href="javascript:;" id="search" url="{:U('index')}"><i class="btn-search"></i></a>
			</div>
		</div>
    </div>
    <!-- 数据列表 -->
    <div class="data-table table-striped">
	<table class="">
    <thead>
        <tr>
		<th class="row-selected row-selected"><input class="check-all" type="checkbox"/></th>
		<th class="">项目名称</th>
		<th class="">项目联系人</th>
		<th class="">联系方式</th>
		<th class="">预算</th>
		<th class="">周期</th>
		<th class="">有效期</th>
		<th class="">竞标人数</th>
		<th class="">竞标状态</th>
		<th class="">雇主类型</th>
		<th class="">状态</th>
		<!--<th class="">操作</th>-->
		</tr>
    </thead>
    <tbody>
		<notempty name="_list">
		<volist name="_list" id="vo">
		<tr>
            <td><input class="ids" type="checkbox" name="id[]" value="{$vo.id}" /></td>
			<td><a href="{:U('Operate/proinfo', [ 'id'=>$vo['id'] ])}" title="{$vo.name}">{$vo.name}</a></td>
			<td>{$vo.linkname}</td>
			<td>{$vo.linknum}</td>
			<td>{$vo.budget|default=0}元</td>
			<td>
				<if condition="$v['duration'] eq 1">一周内
				<elseif condition="$v['duration'] eq 2"/>一月内
				<elseif condition="$v['duration'] eq 3"/>三月内
				<elseif condition="$v['duration'] eq 4"/>半年内
				<else/>未写时间
				</if>
			</td>
			<td><php>echo date('Y-m-d H:i:s', $vo['create_time'] + $vo['dieday'] * 86400);</php></td>
			<td>{$vo.bidnum}</td>
			<td>
				<if condition="$vo['bidstate'] eq 1"><b style="color:#4cdb00;">已完成</b>
				<elseif condition="$vo['bidstate'] eq 2"/><i class="badge-warning">竞标中</i>
				<elseif condition="$vo['bidstate'] eq 4"/><i class="badge-warning">工作中</i>
				<else/><i style="color: red;">未中标</i></if>
			</td>
			<td><if condition="$vo['type'] eq 1">个人<elseif condition="$vo['type'] eq 2"/>设计院<else/>公司</if></td>
			<td>
                <if condition="$vo['status'] eq 1"><b style="color:#4cdb00;">已通过</b>
					<elseif condition="$vo['status'] eq 2"/><i class="badge-warning">待审</i>
					<else/><i style="color: red;">已拒绝</i>
				</if>
			</td>
			<!--<td>
				<neq name="vo.status" value="1">
                    <a href="{:U('Operate/succPro', [ 'id' => $vo['id'] ])}" class="ajax-get">通过</a>
				</neq>
                <eq name="vo.status" value="2">
                    <a href="{:U('Operate/denyPro', [ 'id' => $vo['id'] ])}" class="ajax-get">拒绝</a>
                </eq>
				&lt;!&ndash;<a href="{:U('Operate/delPro', [ 'id' => $vo['id'] ])}" class="confirm ajax-get">删除</a>&ndash;&gt;
			</td>-->
		</tr>
		</volist>
		<else/>
		<td colspan="9" class="text-center"> aOh! 暂时还没有内容! </td>
		</notempty>
	</tbody>
    </table>
	</div>
    <div class="page">
        {$_page}
    </div>
</block>

<block name="script">
	<script src="__STATIC__/thinkbox/jquery.thinkbox.js"></script>

	<script type="text/javascript">
	//搜索功能
	$("#search").click(function(){
		var url = $(this).attr('url');
        var query  = $('.search-form').find('input').serialize();
        query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
        query = query.replace(/^&/g,'');
        if( url.indexOf('?')>0 ){
            url += '&' + query;
        }else{
            url += '?' + query;
        }
		window.location.href = url;
	});
	//回车搜索
	$(".search-input").keyup(function(e){
		if(e.keyCode === 13){
			$("#search").click();
			return false;
		}
	});
    //导航高亮
    highlight_subnav("{:U('Operate/index')}");
	</script>
</block>
